INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${3RDPARTY_DIR}/include/QWindowKit)
SET(LIB_NAME OCApplication)

set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(QRC_SOURCE_FILES resources.qrc)
    
qt5_add_resources(QRC_FILES 
    ${QRC_SOURCE_FILES}
)
SOURCE_GROUP("Resource Files" FILES ${QRC_SOURCE_FILES})

INCLUDE_DIRECTORIES(${OC_QT_PATH}/include)
INCLUDE_DIRECTORIES(${OC_QT_PATH}/include/QtWidgets)
INCLUDE_DIRECTORIES(${OC_QT_PATH}/include/QtCore)
INCLUDE_DIRECTORIES(${OC_QT_PATH}/include/QtGui)

LINK_DIRECTORIES(${OC_QT_PATH}/lib)

SET(TARGET_H
    windowbar.h
    windowbutton.h
    LabViewer.h
    LabTool.h
    ToolHttp/HttpWidget.h
    ToolOblique/ObliqueWidget.h
    ToolWeather/WeatherWidget.h
)

SET(TARGET_SRC
    windowbar.cpp
    windowbutton.cpp
    LabViewer.cpp
    LabTool.cpp
    main.cpp
    OCApplication.rc
    ${QRC_FILES}
    ToolHttp/HttpWidget.cpp
    ToolOblique/ObliqueWidget.cpp
    ToolWeather/WeatherWidget.cpp
)

SETUP_GROUP()

SET(TARGET_COMMON_LIBRARIES 
    OCMain
    OCOsg2Cesium
    OCNetCDF
    OCGrib
    OCVolume
    QWKCore
    QWKWidgets
)

SETUP_APPLICATION(${LIB_NAME})
ADD_DEPENDENCIES(${LIB_NAME} OCOsg2Cesium)
ADD_DEPENDENCIES(${LIB_NAME} OCNetCDF)
ADD_DEPENDENCIES(${LIB_NAME} OCGrib)

if (MSVC)
  set_property(TARGET ${LIB_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY ${OUTPUT_BINDIR})
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /Zc:__cplusplus")
qt5_use_modules( ${LIB_NAME} Widgets Network)

#qt6_use_modules( ${LIB_NAME} Xml )
